package com.sinochem.yunlian.ship.common.enums;

import lombok.Getter;

/**
 * @Auther: pan
 * @Dscription: 用户认证状态
 * @Date: Create in 2017/11/20 16:05
 **/
public enum UserAuthStatus {
    UN_AUTH(0 , "未认证"),
    AUTHING(1 , "认证中"),
    JOINING(2 , "加入中"),
    AUTHED(3 , "已认证"),
    AUTH_FAILED(4 , "认证失败"),
    JOIN_FAILED(5 , "加入失败");

    @Getter
    private int code;
    @Getter
    private String name;

     UserAuthStatus(int code, String name){
         this.code = code;
         this.name = name;
    }

    public static UserAuthStatus getStatusByCode(int code) {
        for (UserAuthStatus userAuthStatus : UserAuthStatus.values()) {
            if (userAuthStatus.getCode() == code) {
                return userAuthStatus;
            }
        }
        return null;
    }



}
